package com.treasure.mall.biz.mapstruct;

import com.treasure.mall.biz.entity.contact.ChatPO;
import com.treasure.mall.biz.entity.user.UserPO;
import com.treasure.mall.biz.vo.contact.ChatVO;
import com.treasure.mall.biz.vo.user.UserBasicVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 
 * <p>
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.biz.mapstruct
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/8/12 3:19 下午
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 * 
 */
@Mapper
public interface ContactMapStruct {
    ContactMapStruct INSTANCE = Mappers.getMapper(ContactMapStruct.class);

    UserBasicVO userPo2userVo(UserPO po);

    @Mappings(
            @Mapping(target = "userBasic", source = "userPO")
    )
    ChatVO po2vo(ChatPO po);

    List<ChatVO> pos2vos(List<ChatPO> pos);
}
